<template>
    <div class="brand-detail">
        <div class="head">
            <van-nav-bar
            title="标题"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
            />
        </div>
        <div class="banner">
            <img :src="this.mydata.app_list_pic_url" alt="">
            <div class="info">
                <p>{{this.mydata.name}}</p>
            </div>
            <p class="desc">{{this.mydata.simple_desc}}</p>
        </div>

        <div class="sortlist">
            <van-grid :column-num="2" :gutter="5">
                <van-grid-item  v-for=" item in goodslist" :key="item.id" :to="`/cart/goods?id=${item.id}`">
                    <van-image :src="item.list_pic_url"  class="img"/>
                    <p class="name">{{item.name}}</p>
                    <p class="price">￥{{item.retail_price}}</p>
                </van-grid-item>
            </van-grid>
        </div>
    </div>
</template>

<script>
import {Bdetailaction} from '@/api/home/brand'
    export default {
        data() {
            return {
                mydata:{},
                goodslist:[]
            }
        },
        created() {
            Bdetailaction({
                id:this.$route.query.id
            })
            .then(res=>{
                console.log(res);
                this.mydata=res.data
                this.goodslist=res.goodsList
                console.log(this.goodslist);
                
            })
        },
        methods:{
             onClickLeft(){
                this.$router.go(-1);
                this.$store.commit('setInfo',"")
            
            }
        }
    }
</script>

<style lang="scss" scoped>

@mixin guid-sty{

    .img{
        width: 150px;
        height: 150px;
        margin: 0 auto;
    }

    .name{
        margin: 7.5px 12px 0;
        text-align: center;
        padding: 0 10px;
        font-size: 12px;
    }
    .price{
        text-align: center;
        font-size: 15px;
        color: #b4282d;
        margin-bottom: 0;
    }
}
.brand-detail{
    background-color: #eee;
}
.head {
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 9;
}

.banner{
    position: relative;
    margin-top: 50px ;

    img{
        width: 100%;
        height: 145px;
    }

    .info{
        
        p{
            position: absolute;
            top: 70px;
            left:50%;
            transform: translateX(-50%);
            margin: 0;
            font-size: .50667rem;
            color: #fff;
            border-bottom: 2.5Px solid #fff;
            padding: 2.5px;

        }

    }

    .desc{
        background: #fff;
        padding: 15px 20px;
        font-size: 15px;
        color: #666;
        text-align: center;
        margin: 0;
    }
}
.sortlist{
    @include guid-sty;
}
</style>